package com.yx.common.core.tree;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

/**
 * @author baolian.sun
 * @date 2023/4/7
 * @desc --
 */
@Setter
@Getter
@NoArgsConstructor
public class TreeNode {

   /** 节点ID */
   private Integer id;

   /** 父节点ID：顶级节点为0 */
   private Integer parentId;

   /** 节点名称 */
   private String label;

   /** 子节点 */
   private List<TreeNode> children;

   public TreeNode(Integer id, Integer parentId, String label) {
      this.id = id;
      this.parentId = parentId;
      this.label = label;
   }
}
